package com.ruoyi.ybUpload.service.tableCode.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ybUpload.mapper.TraceCodeMapper;
import com.ruoyi.ybUpload.domain.tableCode.TraceCode;
import com.ruoyi.ybUpload.service.tableCode.ITraceCodeService;

/**
 * 药品批次表Service业务层处理
 *
 * @author wkw
 * @date 2024-08-07
 */
@Service
public class TraceCodeServiceImpl implements ITraceCodeService
{
    @Autowired
    private TraceCodeMapper traceCodeMapper;

    /**
     * 查询药品批次表
     *
     * @param id 药品批次表主键
     * @return 药品批次表
     */
    @Override
    public TraceCode selectTraceCodeById(Long id)
    {
        return traceCodeMapper.selectTraceCodeById(id);
    }

    /**
     * 查询药品批次表列表
     *
     * @param traceCode 药品批次表
     * @return 药品批次表
     */
    @Override
    public List<TraceCode> selectTraceCodeList(TraceCode traceCode)
    {
        return traceCodeMapper.selectTraceCodeList(traceCode);
    }



    /**
     * 新增药品批次表
     *
     * @param traceCode 药品批次表
     * @return 结果
     */
    @Override
    public int insertTraceCode(TraceCode traceCode)
    {
        traceCode.setCreateTime(DateUtils.getNowDate());
        return traceCodeMapper.insertTraceCode(traceCode);
    }

    /**
     * 修改药品批次表
     *
     * @param traceCode 药品批次表
     * @return 结果
     */
    @Override
    public int updateTraceCode(TraceCode traceCode)
    {
        traceCode.setUpdateTime(DateUtils.getNowDate());
        return traceCodeMapper.updateTraceCode(traceCode);
    }

    /**
     * 批量删除药品批次表
     *
     * @param ids 需要删除的药品批次表主键
     * @return 结果
     */
    @Override
    public int deleteTraceCodeByIds(Long[] ids)
    {
        return traceCodeMapper.deleteTraceCodeByIds(ids);
    }

    /**
     * 删除药品批次表信息
     *
     * @param id 药品批次表主键
     * @return 结果
     */
    @Override
    public int deleteTraceCodeById(Long id)
    {
        return traceCodeMapper.deleteTraceCodeById(id);
    }
}